<template>
  <div class="Log">
    <van-nav-bar
        title="病情日志详情"
        left-text=""
        left-arrow
        @click-left="$router.push('/MyIllnessLog')"/>
    <div class="List">
      <div>
        <p>文本描述</p>
        <p class="text">
          <span>1、跟睛(月光呆滞,凝视,左上斜视,闭眼,不自主眨眼...)</span><br>
          <span>2、口(口唇颜色正常,口唇颜色发青,口唇颤色发白)，牙关紧闭，咬牙，有无咬舌,口吐白沫，无咬牙现象，喉咙发生(咕噜声)</span><br>
          <span>3、头领(左歪,后仰,右歪,前倾）,面色(通红，苍白)</span>
        </p>
      </div>
      <van-divider/>
      <p>图片描述</p>
      <div class="bannerList">
        <van-swipe class="my-swipe"
                   :autoplay="3000"
                   indicator-color="white">
          <van-swipe-item v-for="item in bannerImgList" :key="item.id">
            <img :src='item.src' alt=""></van-swipe-item>
        </van-swipe>
      </div>
      <van-divider/>
      <div class="updateBtn">
        <van-button type="info" @click="updateBtn">编辑</van-button>
      </div>
    </div>
  </div>
</template>

<script>
import {mapGetters} from "vuex";
import {formatDate} from "@/utils/date";

export default {
  name: "Log",
  mounted() {
    console.log('日期=' + JSON.stringify(this.$route.query));
    this.writeTime = this.$route.query.date
    console.log(this.writeTime)
  },
  computed: {
    ...mapGetters(['bannerImgList'])
  },
  data() {
    return {
      writeTime: ''
    }
  },
  methods: {
    updateBtn() {
      this.$dialog.alert({
        message: '暂时不可编辑哟',
      }).then(() => {
        // on close
      });
    },
  },
  filters: {
    //时间戳转换为日期格式
    formatDate(time) {
      let date = new Date(time);
      return formatDate(date, "yyyy-MM-dd");
    },
  },
};
</script>

<style scoped lang="less">
.Log {
  background-color: white;

  .List {
    padding: 0.5rem;
  }

  .text {
    display: inline-block;
    padding: 0 0.5rem;
    font-size: 14px;
  }
}

.bannerList {
  width: 100%;
  height: 200px;

  img {
    width: 100%;
    height: 200px;
  }
}

.updateBtn {
  display: flex;
  justify-content: center;
  align-items: center;

  button {
    border-radius: 5px;
  }
}
</style>
